<?php

namespace Library\Entities;

class Users extends \Library\Entity {

    protected $email,
            $name,
            $registration_date,
            $active_account,
            $activation_key,
            $groupowner;

    const EMAIL_INVALIDE = 2;

    public function isValid() {
        return !(empty($this->title));
    }

// SETTERS //
    public function setEmail($email) {
        if (!is_string($email) || empty($email))
            $this->erreurs[] = self::EMAIL_INVALIDE;
        else
            $this->email = $email;
    }

    public function setName($name) {
        $this->name = $name;
    }
    
    public function setGroupOwner($groupowner) {
        $this->groupowner = $groupowner;
    }
    
    public function setRegistration_Date($registration_date) {
        $this->registration_date = $registration_date;
    }
    
    public function setActivation_key($activation_key) {
        $this->activation_key = $activation_key;
    }
    
    public function SetActive_account($active_account) {
        $this->active_account = $active_account;
    }

// GETTERS //

    public function email() {
        return $this->email;
    }
    
    public function groupowner() {
        return $this->groupowner;
    }
    
    public function name() {
        return $this->name;
    }
    
    public function registration_Date() {
        return $this->registration_date;
    }
    
    public function activation_key() {
        return $this->activation_key;
    }
    
    public function active_account() {
        return $this->active_account;
    }

}

?>
